package com.bw.wxy.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.bw.wxy.R;
import com.bw.wxy.mvp.view.video.adapter.VideoVpAdapter;
import com.flyco.tablayout.SlidingTabLayout;

import java.util.ArrayList;
import java.util.List;

public class Fragment_video extends Fragment {
    private View inflate;
    private SlidingTabLayout videoTab;
    private ViewPager videoVp;
    private VideoVpAdapter videoVpAdapter;

    public Fragment_video() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        inflate = inflater.inflate(R.layout.fragment_video, container, false);
        videoTab = inflate.findViewById(R.id.video_tab);
        videoVp = inflate.findViewById(R.id.video_vp);
        List<Fragment> list=new ArrayList<>();
        list.add(new Fragment_Recommend());
        list.add(new Fragment_Small_Video());
        List<String> strings=new ArrayList<>();
        strings.add("推荐");
        strings.add("小视频");
        videoVpAdapter=new VideoVpAdapter(getChildFragmentManager(),list,strings);
        videoVp.setAdapter(videoVpAdapter);
        videoTab.setViewPager(videoVp);
        return inflate;
    }
}